import request from '@/utils/request'

// 查询未排程派发详细
export function getWProject(query) {
    return request({
        url: '/lims/contract/point/pointList',
        method: 'get',
        params: query
    })
}
// 查询已排程派发详细
export function getYProject(query) {
    return request({
        url: '/lims/contract/project/list',
        method: 'get',
        params: query
    })
}

// 排程按钮
export function addProject(data) {
    return request({
        url: '/lims/contract/project',
        method: 'post',
        data: data
    })
}
// 新增批量排程派发
export function addBatchProject(data) {
    return request({
        url: '/lims/contract/project/batch',
        method: 'post',
        data: data
    })
}


// 查询合同登记详细
export function getContract(contractId) {
    return request({
        url: '/lims/contract/' + contractId,
        method: 'get'
    })
}
// 查询方案数量
export function getProjectCount(query) {
    return request({
        url: '/lims/contract/project/count',
        method: 'get',
        params: query
    })
}

export function getSyProject(projectId) {
    return request({
        url: '/lims/cyTask/syProject/' + projectId,
        method: 'get',
    })
}

export function createSySampleCode(projectId) {
    return request({
        url: '/lims/cyTask/createSySampleCode/' + projectId,
        method: 'post'
    })
}

// 手动派发按钮
export function sendProject(projectIds) {
    return request({
        url: '/lims/contract/project/send/' + projectIds,
        method: 'post',
        isTimeOut: 12000
    })
}

// 自动派发按钮
export function autoSendProject(data) {
    return request({
        url: '/lims/contract/project/autoSend',
        method: 'put',
        data: data
    })
}
// 点击编辑查询
export function pcListProject(projectId) {
    return request({
        url: '/lims/contract/project/pcList/' + projectId,
        method: 'get',
    })
}

// 点击编辑查询
export function getSendCount(contractId) {
    return request({
        url: '/lims/contract/project/sendCount/' + contractId,
        method: 'get',
    })
}

// 删除已排程列表
export function delProject(projectId) {
    return request({
        url: '/lims/contract/project/delete/' + projectId,
        method: 'delete',
    })
}

// 排程方案的弹出框编辑保存
export function addEiditProject(data) {
    return request({
        url: '/lims/contract/project/updateProjectPc',
        method: 'post',
        data: data
    })
}

//取消派发的方案重新排程，慎用当前操作会删除方案关联的所有数据。
export function cancelProject(data) {
    return request({
        url: '/lims/contract/project/cancel',
        data: data,
        method: 'delete',
    })
}
